<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="__STATIC__/layuimini/lib/layui-v2.6.3/css/layui.css" media="all">
    <title>Title</title>
</head>
<!--导航栏的style-->
<style>
    .main{
        height: calc( 100vh );
        display: flex;
        float: left;
    }
    .ulleft{
        height: 100%;
    }
    .logOff{
        position: fixed;
        bottom: -386px;
    }
</style>
<!--本页的style-->
<style>
    .submit_title_text{
        position: fixed;
        top: 180px;
        left: 500px;
        font-size: 25px;
    }
    .submt_title_input{
        position: fixed;
        top: 180px;
        left: 650px;
    }

    .submit_title_btn{
        position: fixed;
        top: 430px;
        left: 900px;
    }

    .submit_teacher_text{
        position: fixed;
        top: 280px;
        left: 500px;
        font-size: 25px
    }

    .submt_teacher_input{
        position: fixed;
        top: 280px;
        left: 650px;
    }
    #ii{
        position: fixed;
        left: 200px;
        top: 0px;
    }
</style>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<script src="__STATIC__/layuimini/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="__STATIC__/layuimini/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<body>
<div>
    <img id="ii" src="../../../static/img/捕获.JPG" alt="">
    <!--导航栏   -->
    <div class="main"  style="width: auto;">
        <ul  id="test" class="ulleft  layui-nav layui-nav-tree" lay-filter="test">
            <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/stu_home">毕业设计管理系统</a></li>
            <li class="layui-nav-item"><a href="">用户：{$Think.session.stu_name}</a></li>
            <li class="layui-nav-item"><a href=""></a></li>
            <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/stu_submit_title" >提交课题</a></li>
            <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/stu_modify_title">修改课题</a></li>
            <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/stu_show_title">我的课题</a></li>
            <li class="layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/student_start_words">发起留言</a></li>
            <li class="logOff layui-nav-item"><a href="http://cmf.yeeyeeyjy.top/lunwen/login/loginOut">注销</a></li>
        </ul>
    </div>
    <!--内容-->

    <!--<form action="http://cmf.yeeyeeyjy.top/lunwen/stu_submit_title/submit" method="post">-->

    <div class="submit_title_text"><p>填写课题：</p></div>
    <div class="submt_title_input"><input id="input_title" name="title" type="text" style="width: 300px; height: 30px" placeholder="请输入课题"></div>
    <div class="submit_teacher_text"><p>填写导师：</p></div>
    <div class="submt_teacher_input"><input  name="teacher" type="text" style="width: 300px; height: 30px" placeholder="请输入导师名称"></div>
    <button id="kk" class="submit_title_btn layui-btn layui-btn-primary" >提交</button>
    <!--onclick="return notNull()-->
</div>
<script>
    function notNull() {
        if (document.getElementById("input_title").value==''){
            alert("标题不能为空");
            return false;
        }
    }
</script>

<script>
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer;
    $("button#kk").click(function () {
        var title = $("input[name=title]").val();   //获取输入框的数据
        var teacher = $("input[name=teacher]").val();   //获取输入框的数据
        //var idcard = $("input#userId").val();
        //var stuname = $("input#name").val();
        $.ajax({
            type: "post",
            async: true,
            url: "{:url('submit')}",
            data: {
                title: title,
                teacher: teacher
            },
            //检测请求成功后返回的数据，登录成功/账号密码错误等等
            success: function (result) {
                var result_code = JSON.stringify(result.code);  //JSON转换成字符串
                var result_msg = JSON.stringify(result.msg);
                var result_data = JSON.stringify(result.data);
                if (result_code !== '1') {
                    // 我在 login_check 方法定义非1为登录失败
                    layer.msg(result_msg);  //小弹框提示登录失败
                } else {
                    // 登录成功后跳转的后台页面，要自己补全
                    layer.msg(result_msg);  //小弹框提示登录成功，你可以改成跳转到后台页
                    window.location.href = 'http://cmf.yeeyeeyjy.top/lunwen/stu_show_title';
                }
            },
            error: function (result) {
                //这里是请求失败的处理，可以给调试使用或者用户网络问题的时候提示
                parent.layer.msg("服务器接口异常，请稍后再试");
                console.log(result);
            }
        });
    });
});
</script>
</body>
</html>